#pragma once
#include <winsock2.h>

#define CONNECT_CHECK() {	if ( 0 == len ) \
							return 0; \
							if ( !m_bConnect ) \
							return -2; \
							if ( NULL == buf ) \
							return -3; }

class hereBaseSocket
{
public:
	hereBaseSocket(void);
	~hereBaseSocket(void);

	int connect(char *s_addr_dst, USHORT u_port);
	void disconnect();
	BOOL isConnected() { return m_bConnect; }
	int send_req(char *buf, int len);
	int recv_resp(char *buf, int len);

private:
	SOCKET m_lSocket;
	BOOL m_bConnect;
};
